<?php
$class = $_GET['class'];
include ("conn.php");
//下面是读取数据
$sql = "SELECT id,title FROM pageList WHERE class LIKE '%".$class."%'";
$result = $conn->query($sql);
$arr = array(); 
if ($result->num_rows > 0) {
    // 输出数据
    while($row = $result->fetch_assoc()) {
    	$arr2=array();
        array_push($arr2,$row["id"]);
        array_push($arr2,$row["title"]);
        array_push($arr,$arr2);
    }
}
echo json_encode($arr); 
?>